<?php $this->load->view('admin/public/head.html', array('css' => array(
    '/assets/admin/css/admin/common.css'
))); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper goodsSettingAdmin" ng-controller="admin-goods-express-controller">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            商城管理
            <small>商城物流基础配置</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 商城管理</a></li>
            <li class="active">运费模板</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <!-- Your Page Content Here -->
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">运费模板设置</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <h4 style="font-size: 14px; padding-left: 30px;" class="text-warning">运费模板说明:</h4>
                        <ul style="font-size: 12px; color: #CCCCCC; line-height: 25px; padding-left: 44px;">
                            <li>以下为商城默认运费模板,目前只支持全国统计物流设置,此项不可删除;</li>
                            <li>模板设置可选择由买家按所购买的商品数量支付运费,也可以选择由卖家支付.按重计价分为售重和续重两块,商品重量在首重范围内,按首重金额计,超出部分按重量累加;</li>
                            <li>需要使物流模板生效,需要在创建商品时,在“运费设置”中选择“运费模板”一项,此外在添加商品时,还需要为商品指定物流重量,可以为0,则不计价;</li>
                        </ul>
                        <form class="form-horizontal">
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="tmpName" class="col-sm-2 control-label">模板名称</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" id="tmpName" ng-model="tmp.tmpName" placeholder="模板名称">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="dispatchAddress" class="col-sm-2 control-label">发货地址</label>

                                    <div class="col-sm-8">
                                        <input type="text" class="form-control" ng-model="tmp.dispatchAddr" id="dispatchAddress" placeholder="发货地址">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">是否包邮</label>
                                    <div class="col-sm-8">
                                        <p class="help-block">
                                            <span class="exp-btn" ng-click="setPayer('buyer')"><i class="fa" ng-class="{'fa-dot-circle-o': tmp.payer == 'buyer', 'text-green': tmp.payer == 'buyer', 'fa-circle-o': tmp.payer == 'seller'}"></i> 买家承担运费</span>
                                            <span class="exp-btn" ng-click="setPayer('seller')"><i class="fa" ng-class="{'fa-dot-circle-o': tmp.payer == 'seller', 'text-green': tmp.payer == 'seller', 'fa-circle-o': tmp.payer == 'buyer'}"></i> 卖家包邮</span>
                                        </p>
                                    </div>
                                </div>
                                <div class="form-group" ng-show="tmp.payer == 'buyer'">
                                    <label class="col-sm-2 control-label">计价方式</label>
                                    <div class="col-sm-8">
                                        <p class="help-block">
                                            <span class="exp-btn"><i class="fa-dot-circle-o fa text-green"></i> 按重量</span>
                                        </p>
                                    </div>
                                </div>
                                <div class="form-group" ng-show="tmp.payer == 'buyer'">
                                    <label class="col-sm-2 control-label"></label>
                                    <div class="col-sm-8">
                                        <table class="table table-bordered express-tab">
                                            <tr>
                                                <th style="width: 40%" class="text-center">配送区域</th>
                                                <th class="text-center">首重（KG）</th>
                                                <th class="text-center">首费（元）</th>
                                                <th class="text-center">续重（KG）</th>
                                                <th class="text-center">续费（元）</th>
                                                <th style="width: 60px" class="text-center">操作</th>
                                            </tr>
                                            <tr>
                                                <td><span ng-repeat="a in weightSetting.area" ng-bind="a"></span></td>
                                                <td><input type="text" ng-model="weightSetting.firstWeight" class="form-control input-sm"></td>
                                                <td><input type="text" ng-model="weightSetting.firstCost" class="form-control input-sm"></td>
                                                <td><input type="text" ng-model="weightSetting.incrWeight" class="form-control input-sm"></td>
                                                <td><input type="text" ng-model="weightSetting.incrCost" class="form-control input-sm"></td>
                                                <td>
                                                    <a href="javascritp:;" style="color: #ddd;">
                                                        <i class="fa fa-close"></i> 删除
                                                    </a>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <!-- /.box-body -->
                        </form>
                    </div>
                    <div class="box-footer">
                        <button type="submit" class="btn btn-info pull-right" style="background: #00a65a; border: none;" ng-click="setTmp()">确定设置</button>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array(
    '/assets/admin/js/goods/express.js'
))); ?>
